// src/main/java/jsu/hx/lost/Controller/StatController.java
package jsu.hx.lost.Controller;

import jsu.hx.lost.Model.dto.StatData;
import jsu.hx.lost.Service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/stat")
public class StatController {
    @Autowired
    private StatService statService;

    @GetMapping("/daily")
    public List<StatData> getDailyStats(
            @RequestParam(required = false) String startDate,
            @RequestParam(required = false) String endDate
    ) {
        return statService.getDailyStats(startDate, endDate);
    }
}